package tasks.task02;

import java.io.*;

public class ReadUtils {

    public static String readInput(String path) {

        StringBuffer buffer = new StringBuffer();
        try {
            FileInputStream fis = new FileInputStream(path);
            InputStreamReader isr = new InputStreamReader(fis/*, "UTF8"*/);
            Reader in = new BufferedReader(isr);
            int ch;
            while ((ch = in.read()) > -1) {
                buffer.append((char) ch);
            }
            in.close();
            return buffer.toString();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

}


